package com.itlong.cloud.property.dao;

import com.itlong.cloud.POJO.PO.VisitorPassRecordPO;
import com.itlong.cloud.abstracts.IAbstractBaseDao;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <desc>
 *      访客通行记录Dao
 * </desc>
 *
 * @createDate 2018/06/28
 */
@Mapper
@Repository
public interface IPropertyVisitorPassRecordDao extends IAbstractBaseDao<VisitorPassRecordPO> {

    /**
     * <desc>
     *      保存访客通行记录
     * </desc>
     *
     * @param params 数据参数
     * @return
     * @author JuGuang.S
     * @createDate 2018/06/28
     */
    Integer save(Map<String, Object> params);

    /**
     * <desc>
     *      根据动态密码或访客uuid获取访客Id
     * <desc/>
     *
     * @param dynamicPassword 动态密码
     * @return
     * @author JuGuang.S
     * @createDate 2018/06/28
     */
    String getPassId(@Param("dynamicPassword") String dynamicPassword,@Param("qrcode") String qrcode,@Param("vFaceId") String vFaceId,@Param("projectId") String projectId);

    /**
     * <desc>
     *      根据访客手机号获取访客Id
     * </desc>
     *
     * @param visitorUuid 访客手机号
     * @return 访客Id
     * @author wangzhi
     * @createDate 2019/03/06
     */
    String getPassIdByVisitorPhone(@Param("visitorUuid") String visitorUuid, @Param("projectId") String projectId);

    /**
     * <desc>
     *      根据访客uuid获取访客Id
     * </desc>
     *
     * @param visitorUuid 访客uuid
     * @return 访客Id
     * @author wangzhi
     * @createDate 2019/03/06
     */
    String getPassIdByVisitorUuid(@Param("visitorUuid") String visitorUuid, @Param("projectId") String projectId);

    /**
     * <desc>
     *      获取访客通行密码邀请记录
     * </desc>
     *
     * @param params 查询参数
     * @return 访客通行密码邀请记录
     * @author wangzhi
     * @createDate 2019/06/24
     */
    List<Map<String,Object>> getInviteRecord(Map<String, Object> params);

    /**
     * <desc>
     *      根据动态密码或访客uuid获取访客Id
     * <desc/>
     *
     * @param dynamicPassword 动态密码
     * @return
     * @author JuGuang.S
     * @createDate 2019/11/28
     */
    String getPassIdByVisitor(@Param("dynamicPassword") String dynamicPassword,@Param("qrcode") String qrcode,@Param("projectId") String projectId);

    /**
     * <desc>
     * 访客信息
     * </desc>
     *
     * @param passId
     * @return
     * @author caoshuai
     * @createDate 2021/1/21 15:47
     */
    Map<String,Object> getVisitorsInfo(@Param("passId") String passId);
    /**
     * <desc>
     *      获取设备名称
     * </desc>
     *
     * @param
     * @return
     * @author caoshuai
     * @createDate 2021/1/22 10:11
     */
    String getDeviceNameByMap(Map<String, Object> param);
}
